home *** CD-ROM | disk | FTP | other *** search
/ VRML 2.0 Sourcebook (2nd Edition) / VRML 2.0 Sourcebook CD [md5 fed90f4f9c39d5a60d477058775c7e21].iso / book / unix / ch31 / 31fig09.wrl < prev    next >
Text File  |  1996-09-23  |  1KB  |  53 lines

  1. #VRML V2.0 utf8
  2. # The VRML 2.0 Sourcebook
  3. # Copyright [1997] By
  4. # Andrea L. Ames, David R. Nadeau, and John L. Moreland
  5. PROTO SpinGroup [
  6.     exposedField MFNode  children      [ ]
  7.     exposedField SFTime  cycleInterval 1.0
  8.     exposedField SFBool  loop          FALSE
  9.     exposedField SFTime  startTime     0.0
  10.     exposedField SFTime  stopTime      0.0
  11. ] {
  12.     DEF SpinMe Transform {
  13.         children      IS children
  14.     },
  15.     DEF Clock TimeSensor {
  16.         cycleInterval IS cycleInterval
  17.         loop          IS loop
  18.         startTime     IS startTime
  19.         stopTime      IS stopTime
  20.     },
  21.     DEF Spinner OrientationInterpolator {
  22.         key [ 0.0, 0.5, 1.0 ]
  23.         keyValue [
  24.             0.0 1.0 0.0 0.0,
  25.             0.0 1.0 0.0 3.14,
  26.             0.0 1.0 0.0 6.28
  27.         ]
  28.     },
  29.     ROUTE Clock.fraction_changed TO Spinner.set_fraction
  30.     ROUTE Spinner.value_changed  TO SpinMe.set_rotation
  31. }
  32.  
  33. SpinGroup {
  34.     cycleInterval 4.0
  35.     loop TRUE
  36.     children [
  37.         Shape {
  38.             appearance DEF Green Appearance {
  39.                 material Material { diffuseColor 0.0 1.0 0.3 }
  40.             }
  41.             geometry Box { size 25.0 2.0 2.0 }
  42.         },
  43.         Shape {
  44.             appearance USE Green
  45.             geometry Box { size 2.0 25.0 2.0 }
  46.         },
  47.         Shape {
  48.             appearance USE Green
  49.             geometry Box { size 2.0 2.0 25.0 }
  50.         }
  51.     ]
  52. }
  53.